from Crypto.Util.number import *


def gcd(a, b):
    if (b == 0):
        return a
    else:
        return gcd(b, a % b)


s = [1298464442556404253589469301726686648460018983, 338994730766931101315005874918795942590925307,
     2168707823811104203632607148485605053518724853, 288029652532724308759605145340927661745390045,
     2102954827119688859115426127874941951743005786, 1560424680395670749415624054090677568424727345,
     2008484402896120836081890715352514944733698976, 1953894433135819225331030280684956423391870103,
     1408274506694579684367875564191257622692263409, 95302207855451779037256702518715314619964592]

t = []
for i in range(9):
    t.append(s[i] - s[i - 1])
all_n = []
for i in range(7):
    all_n.append(gcd((t[i + 1] * t[i - 1] - t[i] * t[i]), (t[i + 2] * t[i] - t[i + 1] * t[i + 1])))

MMI = lambda A, n, s=1, t=0, N=0: (n < 2 and t % N or MMI(n, A % n, t, s - A // n * t, N or n), -1)[n < 1]  # 逆元计算
for n in all_n:
    n = abs(n)
    if n == 1:
        continue
    a = (s[2] - s[1]) * MMI((s[1] - s[0]), n) % n
    ani = MMI(a, n)
    b = (s[1] - a * s[0]) % n
    seed = (ani * (s[0] - b)) % n
    plaintext = seed
    print(long_to_bytes(plaintext))
